import { error, log, warn } from "@/util/tio";

/** 命令码字符串的长度 */
export const CMD_LEN = 5;
/** key: "00001", value: "HeartbeatReq" */
export const cmdStr_name_map = {};
/** key: "00001", value: Function */
export const cmdStr_func_map = {};
// /** key: 1, value: "HeartbeatReq" */
// const cmd_name_map = {};
// /** key: 1, value: Function */
// const cmd_func_map = {};

/** 命令需要集中定义，方便查阅和管理 */
export const cmds = {
    HeartbeatReq: [1],
    WxHandshakeReq: [599],
    WxHandshakeResp: [600, ({ tws, bodyObj, bodyStr, cmdName, cmdStr, event }) => {
        log({ tws, bodyObj, bodyStr, cmdName, cmdStr, event })
        // send(tws, cmd.WxFriendMsgReq, bodyObj)
    }],


    WxFriendMsgReq: [604],
    WxFriendMsgResp: [605, ({ tws, bodyObj, bodyStr, cmdName, cmdStr, event }) => {
        log({ tws, bodyObj, bodyStr, cmdName, cmdStr, event })
    }],

    WxUserOperNtf: [700],
}

export default cmds;